/**
 * @Author: Boring
 * @Description:
 * @File:  secret
 * @Date: 2024-03-02 14:50
 */

package secret

import (
	"github.com/gin-gonic/gin"
	"oam-manage-backend/controllers/secret"
)

func create(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/create", secret.Create)
}

func update(secretGroup *gin.RouterGroup) {
	secretGroup.PUT("/update", secret.Update)
}

func delete(secretGroup *gin.RouterGroup) {
	secretGroup.DELETE("/delete", secret.Delete)
}

func deleteList(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/deleteList", secret.DeleteList)
}

func get(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/get", secret.Get)
}

func list(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/list", secret.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	secretGroup := g.Group("/secret")
	create(secretGroup)
	update(secretGroup)
	delete(secretGroup)
	deleteList(secretGroup)
	get(secretGroup)
	list(secretGroup)
}
